package com.qf.boot2202day03.vo;

import com.qf.boot2202day03.util.Constants;

import java.util.HashMap;

public class ReturnVo extends HashMap {

    public static ReturnVo ok(){

        ReturnVo returnVo = new ReturnVo();

        returnVo.put("code", Constants.SUCCESS_CODE);
        returnVo.put("msg","成功");

        return returnVo;
    }
    public static ReturnVo fail(){

        ReturnVo returnVo = new ReturnVo();

        returnVo.put("code", Constants.PARAM_NULL_CODE);
        returnVo.put("msg","参数为空");

        return returnVo;
    }
    public static ReturnVo fail(Integer code,String msg){

        ReturnVo returnVo = new ReturnVo();

        returnVo.put("code",code);
        returnVo.put("msg",msg);

        return returnVo;
    }
}
